#!/bin/zsh
# -----------------------------------------------------------------------------
# Script Name: check-managed-preferences.sh
# Description: Checks if the managed preferences file for TechItOut is present.
#              Exits with 0 if found, and exits with 1 if not found.
#
# Usage: Execute this script on macOS and ensure it has executable permissions:
#        chmod +x check-managed-preferences.sh
#        ./check-managed-preferences.sh
#
# Note: FileWave Client will re-run this script in 2 minutes if it exits with 1.
#
# Author: [Your Name]
# Date: 2025-04-08
# -----------------------------------------------------------------------------

# Define the managed preferences file path.
plist_path="/Library/Managed Preferences/xyz.techitout.appAutoPatch.plist"

# Check if the file exists.
if [[ -f "${plist_path}" ]]; then
    echo "Managed preferences file found at ${plist_path}."
    exit 0   # File exists, exit with status 0.
else
    echo "Managed preferences file not found at ${plist_path}."
    exit 1   # File does not exist, exit with status 1.
fi
 